[Ruby on Rails] scribd_fu gsub error

Posted by siulamvictor on Stack Overflow See other posts from Stack Overflow or by siulamvictor
Published on 2010-04-30T06:59:56Z Indexed on 2010/05/01 12:57 UTC
Read the original article Hit count: 327

Filed under:
|
|

I have an application which allow user upload documents to Scribd. I tried to use scribd_fu in Rails. An error occurred when the controller try to save the model.

NoMethodError in DocumentsController#processupload

private method `gsub' called for nil:NilClass

here is the related controller

def processupload

@document = Document.new(params[:document])
if @document.save
  session[:scribdid] = @document.ipaper_access_key
else
    xxxxx

and this is the related html form

<form action="/documents/processupload" enctype="multipart/form-data" method="post">
<input name="authenticity_token" type="hidden" value="FqTCmlGGIvRjiaiaa+YtF50wgI7FfpxfrZsulLCbXcw=" />
<label class="label_h2">Upload a Document</label>
<input id="document_document_upload" name="document[document_upload]" size="30" type="file" /></div> 
<div class="buttons"><button type="submit" class="positive"><img src="/images/icons/tick.png" alt="Save Document"/>Save Document</button>
</form>

Is there anything wrong?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about scribd